package com.hogae.system.domain;

import com.hogae.core.annotation.Excel;
import com.hogae.core.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.ArrayList;
import java.util.List;

/**
 * 用户层级关系对象 sys_user_tree
 *
 * @author hogae
 * @date 2021-01-22
 */
public class SysUserTree extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 自增ID
     */
    private Long id;

    /**
     * 用户ID
     */
    @Excel(name = "用户ID")
    private Long userId;

    /**
     * 用户名称
     */
    @Excel(name = "用户名称")
    private String userName;

    /**
     * 上级用户ID
     */
    @Excel(name = "上级用户ID")
    private Long parentUserId;

    /**
     * 上级用户名称
     */
    @Excel(name = "上级用户名称")
    private String parentUserName;

    /**
     * 用户层级,0为最顶级，以此递增
     */
    @Excel(name = "用户层级,0为最顶级，以此递增")
    private Long level;

    /**
     * 用户ID层级集合，~分割
     */
    @Excel(name = "用户ID层级集合，~分割 ")
    private String userIdLevel;

    /**
     * 状态，0启用，1禁用，备用字段
     */
    @Excel(name = "状态，0启用，1禁用，备用字段")
    private Long status;

    /**
     * 子部门
     */
    private List<SysUserTree> children = new ArrayList<SysUserTree>();

    public void setId(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getUserName() {
        return userName;
    }

    public void setParentUserId(Long parentUserId) {
        this.parentUserId = parentUserId;
    }

    public Long getParentUserId() {
        return parentUserId;
    }

    public void setParentUserName(String parentUserName) {
        this.parentUserName = parentUserName;
    }

    public String getParentUserName() {
        return parentUserName;
    }

    public void setLevel(Long level) {
        this.level = level;
    }

    public Long getLevel() {
        return level;
    }

    public void setUserIdLevel(String userIdLevel) {
        this.userIdLevel = userIdLevel;
    }

    public String getUserIdLevel() {
        return userIdLevel;
    }

    public void setStatus(Long status) {
        this.status = status;
    }

    public Long getStatus() {
        return status;
    }

    public List<SysUserTree> getChildren() {
        return children;
    }

    public void setChildren(List<SysUserTree> children) {
        this.children = children;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("userId", getUserId())
                .append("userName", getUserName())
                .append("parentUserId", getParentUserId())
                .append("parentUserName", getParentUserName())
                .append("level", getLevel())
                .append("userIdLevel", getUserIdLevel())
                .append("status", getStatus())
                .append("createTime", getCreateTime())
                .append("updateTime", getUpdateTime())
                .toString();
    }
}
